package ${packagePath};

import com.zwb.demo.easyweb.common.entity.response.ResponseResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
/**
 * ${tableDesc}
 *
 * @author ${author}
 * @date ${generateDate}
*/
@RestController
@Api(value = "${tableDesc}接口" ,description = "${tableDesc}接口")
public class ${className}Controller {

    private final ${className}Service ${className?uncap_first}Service;


    @Autowired
    public ${className}Controller(${className}Service ${className?uncap_first}Service) {
        this.${className?uncap_first}Service = ${className?uncap_first}Service;
    }

    @GetMapping("/${moduleName}/${className?uncap_first}")
    @ApiOperation(value = "查询所有${tableDesc}")
    public ResponseResult findAll(){
        return ${className?uncap_first}Service.findAll();
    }

    @PutMapping("/${moduleName}/${className?uncap_first}")
    @ApiOperation(value = "新增或修改${tableDesc}")
    public ResponseResult saveOne(@RequestBody ${className}VO vo){
        return ${className?uncap_first}Service.saveOne(vo);
    }

    @DeleteMapping("/${moduleName}/${className?uncap_first}/{uuid}")
    @ApiOperation(value = "删除${tableDesc}")
    public ResponseResult deleteOne(@PathVariable String uuid){
        return ${className?uncap_first}Service.deleteOne(uuid);
    }

}
